; TEST-ARGS: -disallow-ub-exploitation

@glb = global ptr null

define i8 @src() null_pointer_is_valid {
  call void @fn()
  %ptr = load ptr, ptr @glb
  %r = load i8, ptr %ptr
  ret i8 %r
}

define i8 @tgt() null_pointer_is_valid {
  call void @fn()
  %ptr = load ptr, ptr @glb
  %r = load i8, ptr %ptr
  ret i8 %r
}

declare void @fn()
